<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head">
	<base th:href="@{/}">
	<meta charset="utf-8">
	<title>新增</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="static/layui/css/layui.css" media="all" />
	<script type="text/javascript" src="static/layui/layui.all.js"></script>
	<script type="text/javascript" src="static/layui/tableSelect.js"></script>
	<script type="text/javascript" src="static/plugin/jquery/jquery-3.2.1.min.js"></script>
</head>
<body class="layui-fluid" th:fragment="body">
<div class="layui-row" style="margin-top: 5px;">
	<div class="layui-form-item">
		<label class="layui-form-label">企业编码</label>
		<div class="layui-input-block">
			<input type="text" name="cusCode" lay-verify="required"  id="cusCode" placeholder="请输入" autocomplete="off" class="layui-input" >
		</div>
	</div>
	<div class="layui-col-md12">
		<table id="table" class="layui-table" lay-filter="table"></table>
	</div>
</div>
<script type="text/html" id="tableToolbar" th:inline="javascript">
	<button type="button" lay-event="find" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe615;</i>查询</button>
</script>
<script type="text/javascript">
	var table = layui.table;

	table.render({
		elem: '#table'
		,title: '列表'
		,url: 'manage/common/list/customer'
		,method: 'post'
		,height: 'full-60'
		,page: true //开启分页
		,limit: 20
		,limits: [20, 30, 40, 50, 60, 70, 80, 90, 100]
		,loading: true
		,cols: [
			[
				{ type: 'radio' },
				{ field: 'cusCode', title: '企业编码' },
				{ field: 'cusName', title: '企业名称' },
			]
		]
		,text: {
			none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
		}
		,toolbar: '#tableToolbar'
		,defaultToolbar: ['filter']
	});

	table.on('toolbar(table)', function(obj){
		let cusCode = $('#cusCode').val();
		table.reload('table', {
			where: {cusCode:cusCode} //设定异步数据接口的额外参数
		});
	})



	function getFormDataAndValidate(){
		let checkStatus = table.checkStatus('table'); //idTest 即为基础参数 id 对应的值
		return [true,checkStatus.data[0]];
	}

</script>
</body>
</html>